home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
stats
/
chadyn.exe
/
YPICKMAP.C
< prev
next >
Wrap
Text File
|
1988-12-08
|
6KB
|
194 lines
/****************************** YPICKMAP.C *********************************/
/********************* (C) 1986,7,8 by JAMES A. YORKE ************************/
#include "yinclud.h"
PickMap() { /* Called by main(). Most of the work here is
the selection of default parameters which
are then reset where necessary by init_maps.
*/
FILE * output;
extern int null(), rungekutta (), iterate_map ();
int keycheck();
scr_clr(); /* in desmets pcio.a */
scr_rowcol(0, 0);
clearp();
output = StOutPut; /* this sends the list to the crt */
defaults(); /* in this file */
modPointer = null; /* for differential equations; see
iterate_map() in YTools.c (where it is
called) and and see YMapMenu.C where
nontrivial modPointers are set */
/* ************************ init_map() ***************************** */
init_map(output); /* in YMAPMENU.C; this permits selection of a
map or dif eq from a menu or the map or dif
equ may specified, depending on which files
are compiled together and then it takes
care care of initializing all the parameters
*/
/* ****************************************************************** */
if(num_lyap != -9999 && vec_dim > 0)
dim = lyapzero + num_lyap * vec_dim;
/* needed for rungekutta */
else
dim = lyapzero;
if(steps_per_cycle != -9999. && steps_per_cycle != 0.) {
if(C4 != -9999 && C4 != 0)
step = (twopi / C4) / steps_per_cycle;
else
step = twopi / steps_per_cycle;
}
sixth_step = step / 6.; /* for rungekutta */
halfstep = step / 2;
ScreenConstants();
/* using X_upper, it sets b0 etc needed for MainMenu */
IterIteratee = map; /* so iterate_map() and error_check() will call
whatever map has been set equal to; this
line and the following assignments of map
pointers must be made after init_map() is
called since that may set map */
if(step == -9999.&& num_lyap <= 0 && its_per_plot == 1)
iteratee = map; /* this speeds Henon by 8%; but if num_lyap or
its_per_plot is changed, we must reset
iteratee to be iterate_map; */
if(rho_final == -9999.)
rho_final = rho;
/* for processl(): */
line_x1 = X_lower;
line_y1 = Y_upper;
line_x2 = X_upper;
line_y2 = Y_upper;
GetDiskFileName(); /* basically sets DiskFileName[] =
MapName[].PIC */
picNameFlag = NO; /* this means DiskFileName has not been
accessed */
if(X_coord >= 0)
Xplot[0] = Xplot[1] = Xplot[2] = Xplot[3] = Xplot[4] = &y[X_coord];
if(X_coord == -1)
Xplot[0] = Xplot[1] = Xplot[2] = Xplot[3] = Xplot[4] = ρ
if(Y_coord >= 0)
Yplot[0] = Yplot[1] = Yplot[2] = Yplot[3] = Yplot[4] = &y[Y_coord];
if(Y_coord == -1)
Yplot[0] = Yplot[1] = Yplot[2] = Yplot[3] = Yplot[4] = ρ
ssX_coord[0] = ssX_coord[1] = ssX_coord[2] = ssX_coord[3]
= ssX_coord[4] = X_coord;
ssY_coord[0] = ssY_coord[1] = ssY_coord[2] = ssY_coord[3]
= ssY_coord[4] = Y_coord;
}
defaults() { /* The values -9999 are defaults that tell the
program these variables are not relevant for
the map being studied. For example, if step
= -9999., the program knows it is dealing
with a map, not a differential equation.
*/
int i,
ss;
extern int null(), rungekutta (), iterate_map (), plot ();
crossStatus = OFF;
for(ss = 1; ss < 5; ss++) {
X_low = x_new_low = x_old_low = X_Lo[ss] = -9999.;
Y_low = y_new_low = y_old_low = Y_Lo[ss] = -9999.;
X_upp = x_new_upp = x_old_upp = X_Up[ss] = -9999.;
Y_upp = y_new_upp = y_old_upp = Y_Up[ss] = -9999.;
}
modFlag = NO;
plotPointer = plot;
pIncrement = ρ /* the variable incremented by + and - */
TDFreq = 0;
ScrnSec = 0;
for(ss = 0; ss < 5; ss++) {
xScrPix[ss] = -9999.;
diameters[ss] = 4.;
}
maskdef(mask); /* subroutine defines mask[] */
core_row_bits = 8.* COREROWS;
twopi = 2 * pi;
defaultMessage = "\r";
for(i = 0; i < 10; i++)
message[i] = defaultMessage;/* all are pointers */
#ifdef YYFILE
initFloor(); /* necessary for stack maps and differential
equations */
#endif
y_init_init(); /* initializes the initializer */
store(y, y + eqn0, eqn1);
store(ya, y + eqn1 + eqn0, eqn1);
store(yb, y + eqn1 + eqn0, eqn1);
store(yc, y + eqn1 + eqn0, eqn1);
store(yd, y + eqn1 + eqn0, eqn1);
store(ye, y + eqn1 + eqn0, eqn1);
beta = -9999.;
boxx = 0;
C1 = -9999.; /* This default value is for detecting whether
this variable is in use */
C2 = C3 = C4 = C5 = C6 = C7 = C8 = C9 = -9999.;
dot = 0;
dots = 100000000;
dim = 2; /* basic case */
images = 0;
its_per_plot = 1;
lyaptime = 0; /* setting=0 prevents access to obsolete lyap
exponents */
lyapzero = 2; /* y[lyapzero] is the zeroth coord of the
zeroth lyapunov vector */
max_error = 0.;
num_lyap = -9999; /* number of lyapunov numbers to be computed */
period = 1; /* for the Newton method */
preiter = 0;
screen_fraction = 1./ 128.;
sigma = -9999.;
step = -9999.; /* These values will be used to determine the
process is a map-- not a dif. equ.-- if it
is not changed. */
steps_per_cycle = -9999.;
rad_attr =.1;
ra2 = ra5 = -9999.;
rho = -9999.;
rho_final = -9999;
rho_step = 1.;
vec_dim = 2; /* some default is needed for basin boundaries
*/
X_coord = 0;
Y_coord = 1;
zeroth = 0;
/* DEFAULT POINTERS TO ROUTINES */
DEsolver = rungekutta;
init_process = null; /* This is called in q.c and is carried out
before the process is iterated and after the
menu is exited */
map = rungekutta; /* if the process is not a differential
equation, map is redefined in init_map() */
ChkTrajIteratee = iterate_map;
/* ChkTrajIteratee is called by checkTrajectory() -- which is called by
straddle() and the basinboundary routine */
iteratee = iterate_map;
StraddleIteratee = iterate_map;
}